@{
    TableOfContentsModel? tocModel = Model.GetToc();
}

@if (tocModel?.Node is null)
{
    <br />
}

@{
    var isWip = "false";
    var copyrightHolder = string.Empty;
    var copyrightHolderUrl = string.Empty;
    var footNote = string.Empty;
}

@if ((tocModel?.Root.Metadata?.TryGetValue("theme.silk.wip", out isWip) ?? false) && bool.Parse(isWip) &&
    !Model.GetBool("RawContent"))
{
    <div class="alert alert-danger" role="alert">
        This site is a work in progress!
    </div>
}

@((IHtmlContent) ViewData["body"])

@if (tocModel?.Root.Metadata?.TryGetValue("theme.silk.footer.copyright", out copyrightHolder) ?? false)
{
    <hr class="silk-last-hr">
    <div>
      <div class="col-md-6">
        <div class="copyright">
            &copy; @DateTime.Now.Year
            @if (tocModel?.Root.Metadata?.TryGetValue("theme.silk.footer.copyright.url", out copyrightHolderUrl) ?? false)
            {
                <a href="@copyrightHolderUrl" target="_blank">@copyrightHolder</a>
            }
            else
            {
                <a target="_blank">@copyrightHolder</a>
            }
        </div>
      </div>
    </div>
}

@if (tocModel?.Root.Metadata?.TryGetValue("theme.silk.footer.note", out footNote) ?? false)
{
    <div class="container-fluid">
        <p class="silk-disclaimer">
            <small>@footNote</small>
            <br />
            <br />
            <small>Powered by <a href="https://statiq.dev">Statiq Framework</a></small>
        </p>
    </div>
}
